//
//  CouponViewController.m
//  HengYouCai
//
//  Created by ycgwl on 2017/5/3.
//  Copyright © 2017年 lwj. All rights reserved.
//

#import "CouponViewController.h"
#import "CouponDetailVC.h"
#import "BannerWebViewVC.h"
@interface CouponViewController ()

@end

@implementation CouponViewController

- (void)dealloc{
    NSLog(@"CouponViewController dealloc");
}

- (instancetype)init
{
    self = [super init];
    if (self) {
        
        
        
        //        NSArray *titles = @[@"现金红包",@"加息券"];
        //        CouponDetailVC *couponDetail = [[UIStoryboard storyboardWithName:@"Profile" bundle:nil] instantiateViewControllerWithIdentifier:@"CouponDetailVCID"];
        //        couponDetail.type = @"0";
        //        CouponDetailVC *couponDetail2 = [[UIStoryboard storyboardWithName:@"Profile" bundle:nil] instantiateViewControllerWithIdentifier:@"CouponDetailVCID"];
        //        couponDetail2.type = @"1";
        //
        //        NSArray *vcs = @[couponDetail,couponDetail2];
        //        self.titles = titles;
        //        self.contents = vcs;
        //        self.titleH = 40;
        //        self.intervalH = 10;
        
        //因为懒的改直接改为1个
        NSArray *titles = @[@"加息券"];
        //                CouponDetailVC *couponDetail = [[UIStoryboard storyboardWithName:@"Profile" bundle:nil] instantiateViewControllerWithIdentifier:@"CouponDetailVCID"];
        //                couponDetail.type = @"0";
        CouponDetailVC *couponDetail2 = [[UIStoryboard storyboardWithName:@"Profile" bundle:nil] instantiateViewControllerWithIdentifier:@"CouponDetailVCID"];
        couponDetail2.type = @"1";
        
        NSArray *vcs = @[couponDetail2];
        self.titles = titles;
        self.contents = vcs;
        self.titleH = 0;
        self.intervalH = 10;
    }
    return self;
}
- (void)rightBtn
{
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setTitle:@"规则说明" forState:UIControlStateNormal];
    [btn setTitleColor:Normal_333Color forState:UIControlStateNormal];
    btn.frame = CGRectMake(0, 0, 100, 40);
    btn.contentEdgeInsets = UIEdgeInsetsMake(0,0, 0, -5);
    btn.contentHorizontalAlignment=UIControlContentHorizontalAlignmentRight;
    btn.titleLabel.font = [UIFont systemFontOfSize:14];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
    @weakify(self)
    [[btn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
        BannerWebViewVC *web = [[BannerWebViewVC alloc] initWithUrlStr:HYC_JXQgz title:@"规则说明"];
        [self_weak_.navigationController pushViewController:web animated:YES withHideBottomBarWhenPush:YES pop:YES];
    }];
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = Normal_BackColor;
    self.title = self.titleName; //@"我的加息券";
    [self rightBtn];
    
}

@end

